package states 
{
	import model.MSpaceship;
	import statemachine.IState;
	import statemachine.IStateObject;
	
	/**
	 * ...
	 * @author vkozhaev
	 */
	public class ProcessServiceState extends State implements IState
	{
		public static const NAME:String = "process_service_state";
		public function ProcessServiceState(_stateObject:IStateObject) 
		{
			super(_stateObject);
			this._ticks=SetParameters.PROCESS_SERVICE_STATE
			this._name = NAME;
		}
		
		override public function doInProcess():void 
		{
			this._ticks--;
		}
		
		override public function doAfter():void 
		{
			(this._stateObject as MSpaceship).energy = SetParameters.BASE_ENERGY;
			(this._stateObject as MSpaceship).cargoBay = 0;		
		}
	}

}